package com.caopeng.achievementmanagement.mapper;

import com.caopeng.achievementmanagement.pojo.Achievement;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface AchievementMapper {
    // 得到所有的成果
    public List<Achievement> getAllAchievements();

    // 得到某个人的所有成果
    public List<Achievement> getAchievementsByUserID(long id);

    // 删除成果
    public int deleteAchievement(long id);

    // 上传成果
    public int uploadAchievement(Achievement achievement);

    // 根据id查找Achievement
    public Achievement selectAchievementById(Long id);

    public int updateAchievement(Achievement achievement);

    // 通过title 进行模糊查询
    public List<Achievement> searchByTitle(String title);

    public List<Achievement> searchByTitleAndUserId(long uid, String title);
}
